\section{Source/LinkedList.h}


\begin{footnotesize}\begin{alltt}
00001 \textcolor{preprocessor}{#ifndef LINKED\_LIST\_HEADER}
00002 \textcolor{preprocessor}{}\textcolor{preprocessor}{#define LINKED\_LIST\_HEADER}
00003 \textcolor{preprocessor}{}
00004 \textcolor{preprocessor}{#ifdef \_\_cplusplus}
00005 \textcolor{preprocessor}{}\textcolor{keyword}{extern} \textcolor{stringliteral}{"C"}
00006 \{
00007 \textcolor{preprocessor}{#endif}
00008 \textcolor{preprocessor}{}
00009 \textcolor{comment}{/* TODO:}
00010 \textcolor{comment}{    LL\_GetLastElement;}
00011 \textcolor{comment}{*/}
00012 
00013 \textcolor{preprocessor}{#include <stdlib.h>}
00014 
00015 \textcolor{keyword}{typedef} \textcolor{keyword}{struct }LL_Element
00016 \{
00017     \textcolor{keywordtype}{void} *Data;
00018     \textcolor{keyword}{struct }LL_Element *Next;
00019 \}LL_Element;
00020 
00021 \textcolor{comment}{/*}
00022 \textcolor{comment}{struct \_LL\_Element}
00023 \textcolor{comment}{\{}
00024 \textcolor{comment}{    void *Data;}
00025 \textcolor{comment}{    \_LL\_Element *Next;}
00026 \textcolor{comment}{\};}
00027 \textcolor{comment}{}
00028 \textcolor{comment}{typedef \_LL\_Element LL\_Element;}
00029 \textcolor{comment}{*/}
00030 \textcolor{comment}{/* This function will 'cut' elements off of the end of First, by}
00031 \textcolor{comment}{    placing Second after First}
00032 \textcolor{comment}{}
00033 \textcolor{comment}{    Return:}
00034 \textcolor{comment}{        This function will return a pointer to First}
00035 \textcolor{comment}{*/}
00036 LL_Element *LL\_AppendElement(LL_Element *First, LL_Element *Second);
00037 
00038 \textcolor{comment}{/* This function will insert an element after First, and shift }
00039 \textcolor{comment}{    everything after it along one}
00040 \textcolor{comment}{    }
00041 \textcolor{comment}{    Return:}
00042 \textcolor{comment}{        This function will return a pointer to First}
00043 \textcolor{comment}{*/}
00044 LL_Element *LL\_InsertElement(LL_Element *First, LL_Element *Second);
00045 
00046 \textcolor{comment}{/* This function will return the Nth element from the element From}
00047 \textcolor{comment}{    typically From is the first element in the list, but you know...}
00048 \textcolor{comment}{    Return:}
00049 \textcolor{comment}{        This function will return a pointer to first}
00050 \textcolor{comment}{*/}
00051 LL_Element *LL\_GetNthElementFrom(LL_Element *From, \textcolor{keywordtype}{int} N);
00052 
00053 \textcolor{comment}{/* This function will return the remaining size from the element From,}
00054 \textcolor{comment}{    typically From is the first element to get the total size of the list...}
00055 \textcolor{comment}{*/}
00056 \textcolor{keywordtype}{int} LL\_GetSizeFrom(LL_Element *From);
00057 
00058 \textcolor{comment}{/* This function removes all elements between One and Two}
00059 \textcolor{comment}{    For example:}
00060 \textcolor{comment}{    }
00061 \textcolor{comment}{    Index   [0][1][2][3]}
00062 \textcolor{comment}{    Value   [1][3][5][7]}
00063 \textcolor{comment}{    }
00064 \textcolor{comment}{    After removing all elements between 0 and 2:}
00065 \textcolor{comment}{    }
00066 \textcolor{comment}{    Index   [0][1][2]}
00067 \textcolor{comment}{    Value   [1][5][7]}
00068 \textcolor{comment}{    Return:}
00069 \textcolor{comment}{        This function will return a pointer to One}
00070 \textcolor{comment}{*/}
00071 LL_Element *LL\_RemoveElementsBetween(LL_Element *One, LL_Element *Two);
00072 
00073 \textcolor{comment}{/* This function appends ListTwo on the element ListOne */}
00074 LL_Element *LL\_MergeLists(LL_Element *ListOne, LL_Element *ListTwo);
00075 
00076 \textcolor{comment}{/*This function inserts List at element At}
00077 \textcolor{comment}{    Return:}
00078 \textcolor{comment}{        This functions returns a pointer to At}
00079 \textcolor{comment}{    }
00080 \textcolor{comment}{    NOTE: The last element in List must point to NULL}
00081 \textcolor{comment}{*/}
00082 LL_Element *LL\_InsertListIntoList(LL_Element *At, LL_Element *List);
00083 
00084 \textcolor{preprocessor}{#ifdef \_\_cplusplus}
00085 \textcolor{preprocessor}{}\}
00086 \textcolor{preprocessor}{#endif}
00087 \textcolor{preprocessor}{}
00088 \textcolor{preprocessor}{#endif}
\end{alltt}\end{footnotesize}
